﻿using Andy.Web.CauHinhServiceReference;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Andy.Web.admin
{
    public partial class ht_ql_slide : VdcInc.vdcAJAXPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                loadGrid();
            }
        }
        public void loadGrid()
        {
            using (var chService = new CauHinhServiceReference.CauHinhServiceClient())
            {
                var lstSlide = chService.DanhSachSlide();
                grid1.DataSource = lstSlide;
                grid1.DataBind();
            }
        }
        public string vXoaSlide(string strSlideId)
        {
            using (var chService = new CauHinhServiceReference.CauHinhServiceClient())
            {
                if (!string.IsNullOrEmpty(strSlideId))
                {
                    var sp = new Slide();
                    sp.Id = Convert.ToInt64(strSlideId);
                    var result = chService.CapNhatSlide(sp);
                    return "Xóa " + result;
                }
                return "Xóa thất bại";
            }
        }
    }
}